<style type="text/less">
    @import "/web/public/public.less";
    #hotspot.course{
        .title{
            border-bottom: 1px solid #eeeeee;
            margin-top: 16px;
            .title_txt{
                font-size: 16px;
                font-weight: normal;
                font-stretch: normal;
                line-height: 56px;
                letter-spacing: 0px;
                color: #333333;
                display: inline-block;
            }
            .hot_tab{
                display: inline-block;
                float: right;
                li{
                    display: inline-block;
                    font-size: 16px;
                    font-weight: normal;
                    font-stretch: normal;
                    line-height: 24px;
                    letter-spacing: 2px;
                    color: #7f7f7f;
                    margin-left: 24px;
                    margin-top: 16px;
                    cursor: pointer;
                    text-align: center;
                    &:hover{
                        color: #e60012;
                    }
                }
                .active{
                    border-bottom: 1px solid #e60012;
                    color: #e60012;
                }
            }
        }
        ul.hotspot_list {
            line-height: 24px;
            font-size: 14px;
            color: #6e6e6e;
            /* padding: 0 20px 15px; */
        }

        ul.hotspot_list > li {
            padding-top: 15px;
            cursor: pointer;
            a{
                &:hover{
                    color: #e60012;
                }
            }

        }

        .icon-rank {
            width: 18px;
            height: 18px;
            background: #EEEEEE;
            border-radius: 50%;
            color: #bfbdbd;
            text-align: center;
            line-height: 18px;
        }

        .icon-rank.hexagon {
            width: 20px;
            height: 11px;
            background-color: #FAB349;
            position: relative;
            color: #ffffff;
            font-size: 12px;
            line-height: 1;
            border-radius: 0;
        }

        .icon-rank.hexagon:before {
            content: "";
            position: absolute;
            top: -5px;
            left: 0;
            width: 0;
            height: 0;
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-bottom: 5px solid #FAB349;
        }

        .icon-rank.hexagon:after {
            content: "";
            position: absolute;
            bottom: -5px;
            left: 0;
            width: 0;
            height: 0;
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-top: 5px solid #FAB349;
            vertical-align: text-bottom;
        }

        .icon-rank.rank-2 {
            background-color: #B0BED8;
        }

        .icon-rank.rank-2:before {
            border-bottom-color: #B0BED8;
        }

        .icon-rank.rank-2:after {
            border-top-color: #B0BED8;
        }

        .icon-rank.rank-3 {
            background-color: #F0C48A;
        }

        .icon-rank.rank-3:before {
            border-bottom-color: #F0C48A;
        }

        .icon-rank.rank-3:after {
            border-top-color: #F0C48A;
        }
        .icon-rank + span {
            display: inline-block;
            width: 266px;
            vertical-align: text-top;
            margin-left: 5px;
        }
    }
</style>
<script src="/web/lib/less.min.js"></script>
<#if channel.channelStatus == 1>
    <div id="hotspot" class="course" data-num="${channel.channelCount}">
        <div class="title">
            <p class="title_txt">${channel.channelName}</p>
            <ul class="hot_tab">
                <li class="active">日</li>
                <li>周</li>
                <li>月</li>
            </ul>
        </div>
        <ul class="hotspot_list"></ul>
    </div>
</#if>
<script src="/web/public/public.js"></script>
<#if channel.channelStatus == 1>
    <script>
        function getloadChannelHotSearchData(type) {
            var data = {
                plateId: 105,
                pageNum: 1,
                pageSize: $('#hotspot').data('num'),
                queryType: type
            };
            $.ajax({
                url: ports.loadChannelHotSearchData,
                data: data,
                success: function (res) {
                    var html = '';
                    var list = res.data.list;
                    list.forEach(function (item, i) {
                        if (item.articleOutLinkStatus == 1){
                            html += '<li>' +
                                '<a href="' + item.articleOutLink + '" target="_blank">' +
                                '<icon class="' + 'icon-rank ' + (i < 3 ? 'hexagon' : '') + ' rank-' + (i + 1) + '">' + (i + 1) + '</icon>' +
                                '<span>' + item.articleTitle + '</span>' +
                                '</a>' +
                                '</li>'
                        } else {
                            html += '<li>' +
                                '<a href="' + item.articleUrl + '" target="_blank">' +
                                '<icon class="' + 'icon-rank ' + (i < 3 ? 'hexagon' : '') + ' rank-' + (i + 1) + '">' + (i + 1) + '</icon>' +
                                '<span>' + item.articleTitle + '</span>' +
                                '</a>' +
                                '</li>'
                        }
                    });
                    $('.hotspot_list').html(html);
                }
            })
        }
        getloadChannelHotSearchData(1);
        var $aTabLi = $('#hotspot ul.hot_tab>li');
        $aTabLi.click(function () {
            $aTabLi.removeClass('active');
            $(this).addClass('active');
            console.log($(this).index());
            getloadChannelHotSearchData($(this).index() + 1);
        });
    </script>
</#if>

